package com.eshore.server;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class BootReceiver extends BroadcastReceiver {

    public void onReceive(Context context, Intent intent) { 
         
    	Log.d("BootReceiver",intent.getAction());
        if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED"))
        {
        	Log.d("BootReceiver", "system boot completed"); 
              
        	Intent newIntent= new Intent(Intent.ACTION_RUN);

        	newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); //If activity is not launched in Activity environment, this flag is mandatory to set

        	newIntent.setClass(context, downserver.class);
        	
        	context.startService(newIntent);


         //if you want to start a service, follow below method:


         /*******************************************************

            Intent service = new Intent(yourService.ACTION_START);
            service.setClass(context, yourService.class);
            context.startService(service);


         ******************************************************/
         }
     }
}


